package com.gjt.controller;

import javax.annotation.Resource;


import org.springframework.jdbc.core.JdbcTemplate;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;


/**
 * Created with Intel IDEA.
 *
 * @Auther: gjt
 * @Date: 2024/3/17 15:32
 */
public class getProducer {
    @Resource
    private static JdbcTemplate jdbcTemplate;


    public static void main(String[] args) throws SQLException, ClassNotFoundException {
        String name ="王6";
        int age =18;

        JdbcMysqlemo jdbcMysqlemo = new JdbcMysqlemo();
        Connection connection = jdbcMysqlemo.getConnection();
        CallableStatement callableStatement = connection.prepareCall("{ call pro_first(?, ?,?) }");

        callableStatement.setString(1,name);
        callableStatement.setInt(2,age);
        callableStatement.execute();
        int anInt = callableStatement.getInt(3);
        System.out.println(anInt);
    }






}
